<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Detalles de la Reserva</title>
        <link href="<%=request.getContextPath()%>/css/style.css" rel="stylesheet" type="text/css" media="screen">
    </head>
    <body>
        <f:view>
            <%@ include file="/barra.jsp" %>
            <table width="1242" border="0">
                <tr>
                    <td width="21%" align="left" valign="top">
                        <!-- Divisor del Contenido Principal -->
                        <div id="siteName"> </div>
                        <div id="content"> 
                            <div class="feature">
                                <jsp:directive.include file="/welcomeJSF.jsp" />
                            </div> 
                        </div> 
                        <!-- Fin del Contenido Principal -->
                    </td>
                    <td width="79%" align="left" valign="top">
                        <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
                        <h1>Detalles de la Reserva</h1>
                        <h:form>
                            <h:panelGrid columns="2">
                                <h:outputText styleClass="label" value="Identificador:"/>
                                <h:outputText value="#{reserva.reserva.idReserva}" title="IdReserva" />
                                <h:outputText styleClass="label" value="Fecha Inicio:"/>
                                <h:outputText value="#{reserva.reserva.fechaInicio}" title="FechaInicio" >
                                    <f:convertDateTime type="DATE" pattern="dd/MM/yyyy" />
                                </h:outputText>
                                <h:outputText styleClass="label" value="Hora Inicio:"/>
                                <h:outputText value="#{reserva.reserva.horaInicio}" title="HoraInicio" >
                                    <f:convertDateTime type="TIME" pattern="HH:mm" />
                                </h:outputText>
                                <h:outputText styleClass="label" value="Fecha Fin:"/>
                                <h:outputText value="#{reserva.reserva.fechaFin}" title="FechaFin" >
                                    <f:convertDateTime type="DATE" pattern="dd/MM/yyyy" />
                                </h:outputText>
                                <h:outputText styleClass="label" value="Hora Fin:"/>
                                <h:outputText value="#{reserva.reserva.horaFin}" title="HoraFin" >
                                    <f:convertDateTime type="TIME" pattern="HH:mm" />
                                </h:outputText>
                                <h:outputText styleClass="label" value="Observacion:"/>
                                <h:outputText value="#{reserva.reserva.observacion}" title="Observacion" />
                                <h:outputText styleClass="label" value="IdRecurso:"/>
                                <h:panelGroup>
                                    <h:outputText value=" #{reserva.reserva.idRecurso}"/>
                                    <h:panelGroup rendered="#{reserva.reserva.idRecurso != null}">
                                        <h:outputText value=" ["/>
                                        <h:commandLink value="Ver Detalle" action="#{recurso.detalleSetup}">
                                            <f:param name="jsfcrud.currentReserva" value="#{reserva.asString[reserva.reserva]}"/>
                                            <f:param name="jsfcrud.currentRecurso" value="#{recurso.asString[reserva.reserva.idRecurso]}"/>
                                            <f:param name="jsfcrud.relatedController" value="reserva"/>
                                            <f:param name="jsfcrud.relatedControllerType" value="controller.ReservaController"/>
                                        </h:commandLink>
                                        <h:outputText value=" ]"/>
                                    </h:panelGroup>
                                </h:panelGroup>
                                <h:outputText styleClass="label" value="Id Solicitud-Reserva:"/>
                                <h:panelGroup>
                                    <h:outputText value=" #{reserva.reserva.idSolicitudReserva}"/>
                                    <%--
                                    <h:panelGroup rendered="#{reserva.reserva.idSolicitudReserva != null}">
                                        <h:outputText value=" ["/>
                                        <h:commandLink value="Ver Detalle" action="#{solicitudreserva.detailSetup}">
                                            <f:param name="jsfcrud.currentReserva" value="#{reserva.asString[reserva.reserva]}"/>
                                            <f:param name="jsfcrud.currentSolicitudreserva" value="#{solicitudreserva.asString[reserva.reserva.idSolicitudReserva]}"/>
                                            <f:param name="jsfcrud.relatedController" value="reserva"/>
                                            <f:param name="jsfcrud.relatedControllerType" value="controller.ReservaController"/>
                                        </h:commandLink>
                                        <h:outputText value=" ]"/>
                                    </h:panelGroup>
                                    --%>
                                </h:panelGroup>
                                <h:outputText styleClass="label" value="Uso/Retiro realizado:" />
                                <h:panelGroup>
                                    <h:outputText rendered="#{empty reserva.reserva.usoretiroCollection}" value="(No hay Uso/Retiro)"/>
                                    <h:dataTable value="#{reserva.reserva.usoretiroCollection}" var="item" 
                                                  styleClass="names" headerClass="namesHeader" columnClasses="last,first" 
                                                 rendered="#{not empty reserva.reserva.usoretiroCollection}">
                                        <h:column>
                                            <f:facet name="header">
                                                <h:outputText value="Id Uso/Retiro"/>
                                            </f:facet>
                                            <h:outputText value=" #{item.idUsoRetiro}"/>
                                        </h:column>
                                        <h:column>
                                            <f:facet name="header">
                                                <h:outputText value="Fecha de Uso"/>
                                            </f:facet>
                                            <h:outputText value="#{item.fechaUso}">
                                                <f:convertDateTime type="DATE" pattern="dd/MM/yyyy" />
                                            </h:outputText>
                                        </h:column>
                                        <h:column>
                                            <f:facet name="header">
                                                <h:outputText value="Hora de Uso"/>
                                            </f:facet>
                                            <h:outputText value="#{item.horaUso}">
                                                <f:convertDateTime type="TIME" pattern="HH:mm" />
                                            </h:outputText>
                                        </h:column>
                                        <h:column>
                                            <f:facet name="header">
                                                <h:outputText value="Id Operador"/>
                                            </f:facet>
                                            <h:outputText value=" #{item.idOperador}"/>
                                        </h:column>
                                        <h:column>
                                            <f:facet name="header">
                                                <h:outputText value="Observacion"/>
                                            </f:facet>
                                            <h:outputText value=" #{item.observacion}"/>
                                        </h:column>
                                        <h:column>
                                            <f:facet name="header">
                                                <h:outputText value="Id Reserva"/>
                                            </f:facet>
                                            <h:outputText value=" #{item.idReserva}"/>
                                        </h:column>
                                        <h:column>
                                            <f:facet name="header">
                                                <h:outputText value="Id Ubicacion"/>
                                            </f:facet>
                                            <h:outputText value=" #{item.idUbicacion}"/>
                                        </h:column>
                                        <h:column>
                                            <f:facet name="header">
                                                <h:outputText escape="false" value="&nbsp;"/>
                                            </f:facet>
                                            <h:commandLink value="[ Ver detalle ]" action="#{usoretiro.detailSetup}">
                                                <f:param name="jsfcrud.currentReserva" value="#{reserva.asString[reserva.reserva]}"/>
                                                <f:param name="jsfcrud.currentUsoretiro" value="#{usoretiro.asString[item]}"/>
                                                <f:param name="jsfcrud.relatedController" value="reserva" />
                                                <f:param name="jsfcrud.relatedControllerType" value="controller.ReservaController" />
                                            </h:commandLink>
                                        </h:column>
                                    </h:dataTable>
                                </h:panelGroup>
                                <h:outputText styleClass="label" value="Cancelacion Realizada:" />
                                <h:panelGroup>
                                    <h:outputText rendered="#{empty reserva.reserva.cancelacionCollection}" value="(No hay Cancelacion)"/>
                                    <h:dataTable value="#{reserva.reserva.cancelacionCollection}" var="item" 
                                                  styleClass="names" headerClass="namesHeader" columnClasses="last,first"
                                                 rendered="#{not empty reserva.reserva.cancelacionCollection}">
                                        <h:column>
                                            <f:facet name="header">
                                                <h:outputText value="Id Cancelacion"/>
                                            </f:facet>
                                            <h:outputText value=" #{item.idCancelacion}"/>
                                        </h:column>
                                        <h:column>
                                            <f:facet name="header">
                                                <h:outputText value="Fecha Cancelacion"/>
                                            </f:facet>
                                            <h:outputText value="#{item.fechaCancelacion}">
                                                <f:convertDateTime type="DATE" pattern="dd/MM/yyyy" />
                                            </h:outputText>
                                        </h:column>
                                        <h:column>
                                            <f:facet name="header">
                                                <h:outputText value="Hora Cancelacion"/>
                                            </f:facet>
                                            <h:outputText value="#{item.horaCancelacion}">
                                                <f:convertDateTime type="TIME" pattern="HH:mm" />
                                            </h:outputText>
                                        </h:column>
                                        <h:column>
                                            <f:facet name="header">
                                                <h:outputText value="Observacion"/>
                                            </f:facet>
                                            <h:outputText value=" #{item.observacion}"/>
                                        </h:column>
                                        <h:column>
                                            <f:facet name="header">
                                                <h:outputText value="Id Reserva"/>
                                            </f:facet>
                                            <h:outputText value=" #{item.idReserva}"/>
                                        </h:column>
                                        <h:column>
                                            <f:facet name="header">
                                                <h:outputText escape="false" value="&nbsp;"/>
                                            </f:facet>
                                            <h:commandLink value="[ Ver Detalle ]" action="#{cancelacion.detailSetup}">
                                                <f:param name="jsfcrud.currentReserva" value="#{reserva.asString[reserva.reserva]}"/>
                                                <f:param name="jsfcrud.currentCancelacion" value="#{cancelacion.asString[item]}"/>
                                                <f:param name="jsfcrud.relatedController" value="reserva" />
                                                <f:param name="jsfcrud.relatedControllerType" value="controller.ReservaController" />
                                            </h:commandLink>
                                        </h:column>
                                    </h:dataTable>
                                </h:panelGroup>
                                
                            </h:panelGrid>
                            <br />
                        </h:form>
                    </td>
                </tr>    
            </table>
            <%@ include file="/footer.jsp" %>
        </f:view>
    </body>
</html>
